<?php

	class Site{
		// 成员变量
		var $url;
		var $title;

		// 成员函数
		function setUrl($par){
			$this->url=$par;
		}

		function getUrl(){
			echo $this->url.PHP_EOL;
		}

		function setTitle($par){
			$this->this=$par;
		}

		function getTitle(){
			echo $this->title.PHP_EOL;
		}

	}

	$youj=new Site;
	$taobao=new Site;
	$google=new Site;

	// 调用成员变量，设置标题和URL
	$youj->setTitle( "W3Cschool教程" );
	$taobao->setTitle( "淘宝" );
	$google->setTitle( "Google 搜索" );

	$youj->setUrl('www.w3cschool.cn');
	$taobao->setUrl( 'www.taobao.com' );
	$google->setUrl( 'www.google.com' );

	// 调用成员函数，获取标题和URL
	$youj->getTitle();
	$taobao->getTitle();
	$google->getTitle();

	$youj->getUrl();
	$taobao->getUrl();
	$google->getUrl();
?>